home *** CD-ROM | disk | FTP | other *** search
/ Super PC 34 / Super PC 34 (Shareware).iso / spc / UTIL / DJGPP2 / V2 / DJDEV200.ZIP / include / stdlib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-11  |  3.0 KB  |  112 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #ifndef __dj_include_stdlib_h_
  3. #define __dj_include_stdlib_h_
  4.  
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8.  
  9. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  10.  
  11. #include <sys/djtypes.h>
  12.   
  13. #define EXIT_FAILURE    1
  14. #define EXIT_SUCCESS    0
  15. #define MB_CUR_MAX    __dj_mb_cur_max
  16. #define NULL        0
  17. #define RAND_MAX    2147483647
  18.  
  19. extern int __dj_mb_cur_max;
  20.  
  21. typedef struct {
  22.   int quot;
  23.   int rem;
  24. } div_t;
  25.  
  26. typedef struct {
  27.   long quot;
  28.   long rem;
  29. } ldiv_t;
  30.  
  31. __DJ_size_t
  32. #undef __DJ_size_t
  33. #define __DJ_size_t
  34. __DJ_wchar_t
  35. #undef __DJ_wchar_t
  36. #define __DJ_wchar_t
  37.  
  38. void    abort(void) __attribute__((noreturn));
  39. int    abs(int _i);
  40. int    atexit(void (*_func)(void));
  41. double    atof(const char *_s);
  42. int    atoi(const char *_s);
  43. long    atol(const char *_s);
  44. void *    bsearch(const void *_key, const void *_base, size_t _nelem,
  45.         size_t _size, int (*_cmp)(const void *_ck, const void *_ce));
  46. void *    calloc(size_t _nelem, size_t _size);
  47. div_t    div(int _numer, int _denom);
  48. void    exit(int _status) __attribute__((noreturn));
  49. void    free(void *_ptr);
  50. char *    getenv(const char *_name);
  51. long    labs(long _i);
  52. ldiv_t    ldiv(long _numer, long _denom);
  53. void *    malloc(size_t _size);
  54. int    mblen(const char *_s, size_t _n);
  55. size_t    mbstowcs(wchar_t *_wcs, const char *_s, size_t _n);
  56. int    mbtowc(wchar_t *_pwc, const char *_s, size_t _n);
  57. void    qsort(void *_base, size_t _nelem, size_t _size,
  58.           int (*_cmp)(const void *_e1, const void *_e2));
  59. int    rand(void);
  60. void *    realloc(void *_ptr, size_t _size);
  61. void    srand(unsigned _seed);
  62. double    strtod(const char *_s, char **_endptr);
  63. long    strtol(const char *_s, char **_endptr, int _base);
  64. unsigned long    strtoul(const char *_s, char **_endptr, int _base);
  65. int    system(const char *_s);
  66. size_t    wcstombs(char *_s, const wchar_t *_wcs, size_t _n);
  67. int    wctomb(char *_s, wchar_t _wchar);
  68.  
  69. #ifndef __STRICT_ANSI__
  70.  
  71. #ifndef _POSIX_SOURCE
  72.  
  73. void *        alloca(size_t _size);
  74. long double    _atold(const char *_s);
  75. void        cfree(void *_ptr);
  76. char *        getpass(const char *_prompt);
  77. int        getlongpass(const char *_prompt, char *_buffer, int _max_len);
  78. char *        itoa(int value, char *buffer, int radix);
  79. int        putenv(const char *_val);
  80. int        setenv(const char *_var, const char *_val, int _replace);
  81. long double    _strtold(const char *_s, char **_endptr);
  82. void        swab(const void *from, void *to, int nbytes);
  83.  
  84. #ifndef alloca
  85. #define alloca __builtin_alloca
  86. #endif
  87.  
  88. /* BSD Random Number Generator */
  89. char  *    initstate (unsigned _seed, char *_arg_state, int _n);
  90. char  *    setstate(char *_arg_state);
  91. long    random(void);
  92. int    srandom(int _seed);
  93.  
  94. /* These vary in expected prototype, so we just don't prototype them.
  95. void        xfree(void *_ptr);
  96. void *        xmalloc(size_t _size);
  97. void *        xrealloc(void *ptr, size_t _size);
  98. */
  99.  
  100. #endif /* !_POSIX_SOURCE */
  101. #endif /* !__STRICT_ANSI__ */
  102. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  103.  
  104. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  105. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  106.  
  107. #ifdef __cplusplus
  108. }
  109. #endif
  110.  
  111. #endif /* !__dj_include_stdlib_h_ */
  112.